import fs from "fs";
import path from 'path';
export  function readFile(param){
    let data = {};
    let pathStr = path.join(__dirname, "../src/containers");
    let files =  fs.readdirSync(pathStr);
    files.forEach(function(file){
        let filePath = pathStr + '/' + file;
        let states = fs.statSync(filePath);
        if (states.isDirectory() && fs.existsSync(filePath + '/index.js')) {
            if(param === 'DevConfigs'){
                data[file] = ['./src/containers/'+file+'/index.js'];
            }else if(param === 'ProdConfigs'){
                data['containers/'+file+'/index'] = ['./src/containers/'+file+'/index.js'];
            }
        }
    });
    return data;
};